<template>
  <view v-if="list">
    <z-paging ref="paging" v-model="list" @query="getDetectionList">
      <view class="c-pd">
        <van-cell-group inset v-for="(item, index) in list" :key="index">
          <van-cell :title="item.createTime"></van-cell>
          <van-cell title="脉搏">
            <view slot="label"> {{ item.pIndicatorResult }}{{ item.pIndicatorUnits }} </view>
          </van-cell>
          <van-cell title="血压">
            <view slot="label"> {{ item.bpIndicatorResult }}{{ item.bpIndicatorUnits }} </view>
          </van-cell>
          <van-cell title="收缩压">
            <view slot="label"> {{ item.sbpIndicatorResult }}{{ item.sbpIndicatorUnits }} </view>
          </van-cell>
          <van-cell title="舒张压">
            <view slot="label"> {{ item.dbpIndicatorResult }}{{ item.dbpIndicatorUnits }} </view>
          </van-cell>
        </van-cell-group>
      </view>
    </z-paging>
  </view>
  <view class="w-full" v-else>
    <van-empty description="暂无数据" />
  </view>
</template>

<script setup lang="ts">
import EquipRequest from '@/request/equipRequest';

interface IProps {
  equipId: number;
}

const props = defineProps<IProps>();
const list = ref<ISugarDetectionRes[]>();

/*onMounted(() => {
  getDetectionList();
});*/

const getDetectionList = (pageNo: number, pageSize: number) => {
  EquipRequest.ListSugarDetection({ equipId: props.equipId, current: pageNo, size: pageSize }).then((res) => {
    list.value = res.data;
  });
};
</script>
